//
// Created by yearing on 2021/5/26.
//
// 面试题6：从尾到头打印链表
// 题目：输入一个链表的头结点，从尾到头反过来打印出每个结点的值。
#include <iostream>
#include <stack>

using namespace std;
struct ListNode
{
    int m_value;
    ListNode* m_pNext;
};

void PrintListReversingly_Iteratively(ListNode* phead)
{
    stack<int> data;
    while(phead != nullptr)
    {
        data.push(phead->m_value);
        phead = phead->m_pNext;
    }
}
int main()
{
    unsigned short test = 0xcc06;
    unsigned short value = 0x3;
    unsigned short bit = 2;
    unsigned short set = (value&3) << bit;
    test = (test&(~(3<<bit))) | set;

    printf("0x%x",test);
    return 0;
}
